home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1 / sys / atari / makefile.utl < prev    next >
Encoding:
Makefile  |  1993-01-24  |  5.3 KB  |  200 lines

  1. #    Makefile for NetHack's utility programs.
  2. #    Atari specific version
  3.  
  4. # if your make doesn't define a default SHELL properly, you may need
  5. #    the line below (Atari users will need a bourne work-alike)
  6. # SHELL = /bin/sh
  7.  
  8. # flags may have to be changed as required
  9. # flags for 286 Xenix:
  10. # CFLAGS = -Ml2t16 -O -LARGE -I../include
  11. # LFLAGS = -Ml -F 4000 -SEG 512
  12.  
  13. # flags for 286 Microport SysV-AT
  14. # CFLAGS = -DDUMB -Ml -I../include
  15. # LFLAGS = -Ml
  16.  
  17. # flags for Atari GCC
  18. CFLAGS = -O -I../include
  19. LFLAGS =
  20.  
  21. # flags for debugging:
  22. # CFLAGS = -g -I../include
  23.  
  24.  
  25.  
  26. # yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
  27. # if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
  28. # YACC     = yacc
  29. # LEX      = lex
  30. YACC     = bison -y
  31. LEX      = flex
  32.  
  33. # these are the names of the output files from YACC/LEX. Under MS-DOS
  34. # and similar systems, they may differ
  35. # YTABC = y.tab.c
  36. # YTABH = y.tab.h
  37. # LEXYYC = lex.yy.c
  38. YTABC = y_tab.c
  39. YTABH = y_tab.h
  40. LEXYYC = lexyy.c
  41.  
  42. # Nothing below this line should have to be changed.
  43.  
  44. # utility .c files
  45. MAKESRC = makedefs.c
  46. SPLEVSRC = lev_yacc.c lev_lex.c lev_main.c panic.c
  47. DGNCOMPSRC = dgn_yacc.c dgn_lex.c dgn_main.c
  48. UTILSRCS = $(MAKESRC) $(SPLEVSRC) $(DGNCOMPSRC)
  49.  
  50. # object files for makedefs
  51. MAKEOBJS = makedefs.o ../src/monst.o ../src/objects.o
  52.  
  53. # object files for special levels compiler
  54. SPLEVOBJS = lev_yacc.o lev_lex.o lev_main.o panic.o \
  55.     ../src/alloc.o ../src/drawing.o ../src/decl.o \
  56.     ../src/monst.o ../src/objects.o
  57.  
  58. # object files for dungeon compiler
  59. DGNCOMPOBJS = dgn_yacc.o dgn_lex.o dgn_main.o panic.o ../src/alloc.o
  60.  
  61. # object files for recovery utility
  62. RECOVOBJS = recover.o
  63.  
  64.  
  65. #    dependencies for makedefs
  66. #
  67. makedefs:    $(MAKEOBJS)
  68.     $(CC) $(LFLAGS) -o makedefs $(MAKEOBJS)
  69.  
  70. makedefs.o:  ../include/config.h ../include/permonst.h ../include/objclass.h \
  71.         ../include/monsym.h ../include/artilist.h ../include/qtext.h \
  72.         ../include/patchlevel.h
  73.  
  74. ../include/onames.h: makedefs
  75.     ./makedefs -o
  76. ../include/pm.h: makedefs
  77.     ./makedefs -p
  78. ../src/monstr.c: makedefs
  79.     ./makedefs -m
  80. ../include/vis_tab.h: makedefs
  81.     ./makedefs -z
  82. ../src/vis_tab.c: makedefs
  83.     ./makedefs -z
  84.  
  85. lintdefs:
  86.     @lint -axbh -I../include -DLINT $(MAKESRC) ../src/monst.c ../src/objects.c | sed '/_flsbuf/d'
  87.  
  88.  
  89. # the src Makefile is responsible for knowing when to call this, since
  90. # it knows all about the main src and include files
  91. ../include/date.h::
  92.     ./makedefs -v
  93.  
  94.  
  95. #    dependencies for lev_comp
  96. #
  97. lev_comp:  $(SPLEVOBJS)
  98.     $(CC) $(LFLAGS) -o lev_comp $(SPLEVOBJS)
  99.  
  100. lev_yacc.o:  ../include/hack.h ../include/sp_lev.h
  101. lev_main.o:  ../include/hack.h ../include/sp_lev.h ../include/termcap.h
  102. panic.o:     ../include/config.h
  103.  
  104. lev_lex.o:   ../include/hack.h ../include/lev_comp.h ../include/sp_lev.h lev_lex.c
  105.     $(CC) -c $(CFLAGS) lev_lex.c
  106.  
  107. ../include/lev_comp.h: lev_yacc.c
  108.  
  109. lev_yacc.c: lev_comp.y
  110.     $(YACC) -d lev_comp.y
  111.     mv $(YTABC) lev_yacc.c
  112.     mv $(YTABH) ../include/lev_comp.h
  113.  
  114. lev_lex.c: lev_comp.l
  115.     $(LEX) lev_comp.l
  116.     mv $(LEXYYC) lev_lex.c
  117.  
  118. # with all of extern.h's functions to complain about, we drown in
  119. # 'defined but not used' without -u
  120. lintlev:
  121.     @lint -axhu -I../include -DLINT $(SPLEVSRC) ../src/alloc.c ../src/monst.c ../src/objects.c | sed '/_flsbuf/d'
  122.  
  123.  
  124. #    dependencies for dgn_comp
  125. #
  126. dgn_comp:  $(DGNCOMPOBJS)
  127.     $(CC) $(LFLAGS) -o dgn_comp $(DGNCOMPOBJS)
  128.  
  129. dgn_yacc.o:  ../include/config.h ../include/dgn_file.h
  130. dgn_main.o:  ../include/config.h
  131.  
  132. dgn_lex.o:   ../include/config.h ../include/dgn_comp.h ../include/dgn_file.h dgn_lex.c
  133.     $(CC) -c $(CFLAGS)  dgn_lex.c
  134.  
  135.  
  136. ../include/dgn_comp.h: dgn_yacc.c
  137.  
  138. dgn_yacc.c: dgn_comp.y
  139.     $(YACC) -d dgn_comp.y
  140.     mv $(YTABC) dgn_yacc.c
  141.     mv $(YTABH) ../include/dgn_comp.h
  142.  
  143. dgn_lex.c: dgn_comp.l
  144.     $(LEX) dgn_comp.l
  145.     mv $(LEXYYC) dgn_lex.c
  146.  
  147. # with all of extern.h's functions to complain about, we drown in
  148. # 'defined but not used' without -u
  149. lintdgn:
  150.     @lint -axhu -I../include -DLINT $(DGNCOMPSRC) panic.c ../src/alloc.c | sed '/_flsbuf/d'
  151.  
  152.  
  153. #    dependencies for recover
  154. #
  155. recover: $(RECOVOBJS)
  156.     $(CC) $(LFLAGS) -o recover $(RECOVOBJS)
  157.  
  158. recover.o: ../include/config.h
  159.  
  160.  
  161.  
  162. # using dependencies like
  163. #    ../src/foo::
  164. #        @( cd ../src ; $(MAKE) foo )
  165. # would always force foo to be up-to-date according to the src Makefile
  166. # when it's needed here.  unfortunately, some makes believe this syntax
  167. # means foo always changes, instead of foo should always be checked.
  168. # therefore, approximate via config.h dependencies, and hope that anybody
  169. # changing anything other than basic configuration also knows when not
  170. # to improvise things not in the instructions, like 'make makedefs' here
  171. # in util...
  172.  
  173. # make sure object files from src are available when needed
  174. #
  175. ../src/alloc.o: ../src/alloc.c ../include/config.h
  176.     @( cd ../src ; $(MAKE) alloc.o )
  177. ../src/drawing.o: ../src/drawing.c ../include/config.h
  178.     @( cd ../src ; $(MAKE) drawing.o )
  179. ../src/decl.o: ../src/decl.c ../include/config.h
  180.     @( cd ../src ; $(MAKE) decl.o )
  181. ../src/monst.o: ../src/monst.c ../include/config.h
  182.     @( cd ../src ; $(MAKE) monst.o )
  183. ../src/objects.o: ../src/objects.c ../include/config.h
  184.     @( cd ../src ; $(MAKE) objects.o )
  185.  
  186. # make sure hack.h dependencies get transitive information
  187. ../include/hack.h: ../include/config.h
  188.     @( cd ../src ; $(MAKE) ../include/hack.h )
  189.  
  190. tags: $(UTILSRCS)
  191.     @ctags -tw $(UTILSRCS)
  192.  
  193. clean:
  194.     rm -f *.o
  195.  
  196. spotless: clean
  197.     rm -f lev_lex.c lev_yacc.c dgn_lex.c dgn_yacc.c
  198.     rm -f ../include/lev_comp.h ../include/dgn_comp.h
  199.     rm -f makedefs lev_comp dgn_comp recover
  200.